gui/quickfort: show smoothing designations immediately - #5925
Alistair-Afton wants to merge 1 commit into
Conversation
e229361 to
636cd48
Compare
| if dfhack.gui.matchFocusString(fs, vs) then | ||
| return true | ||
| end | ||
| local lua_focus = fs:match('^[^/]+/(dfhack/lua/.*)$') |
There was a problem hiding this comment.
note for posterity: this regex looks okay. it should resolve quickly into a match or not-match.
it is, in general, a bad idea to have two or more unbounded matches such as .* in a regex.
in this case, the regex is clamped to the start and end of the string, and the first subexpression [^/]+ will consume characters up to the first /. no backtracking is possible, and no backtracking would be possible even if this were a true regex instead of Lua's poor-man's regex.
There was a problem hiding this comment.
I do not really understand the innards of the overlay system, but this looks reasonable and minimal.
Edit: I don't know if it will work in graphics mode. I also don't know if the original issue was for graphics mode, text mode, or both. it's still reasonable code but the issue shouldn't be closed until Bumber64 weighs in.
Allow native viewscreen overlays to match a DFHack Lua screen layered over the native screen. Register the designation renderer for gui/quickfort so smoothing designations are visible immediately after blueprint placement.
636cd48 to
43f8540
Compare
Summary
Fixes #5759.
Testing
test -d C:/Users/Alistair Afton/source/repos/dfhack/test -t dig